/*
 * ProgressBarDelegate.h  0.4.0 / Dec 05, 2010
 *
 * Copyright (c) 2010 - 2011, cute4j.com and contributors.
 *
 * This software is licensed under the LGPL version 2.1 license.
 * A copy of this license is included in the file LICENSE-LGPL.txt.
 */
#ifndef PROGRESSBARDELEGATE_H
#define PROGRESSBARDELEGATE_H

#include "Cute4jSwing.h"

#include "ComponentDelegate.h"

// ProgressBarDelegate Class. --------------------------------------------------

/*!
 * \brief ProgressBar Delegate.
 *
 * \author Slobodan Vrkacevic
 * \version 0.4.0
 */
class CUTE4J_EXPORT ProgressBarDelegate : public ComponentDelegate
{
  Q_OBJECT
protected:
  ProgressBarDelegate(JNIEnv *env, jobject obj);
public slots: // native calls
  void setModel(JNIEnv *env, jint minimum, jint maximum, jint value);
  void setValue(JNIEnv *env, jint value);
  void setMinimum(JNIEnv *env, jint minimum);
  void setMaximum(JNIEnv *env, jint maximum);
  void setOrientation(JNIEnv *env, jint orientation);
  void setProgressString(JNIEnv *env, jstring progressString);
  void setStringPainted(JNIEnv *env, jboolean paintString);
public: // native calls
  static jlong newInstance(JNIEnv *env, jobject obj);
public:
  inline QProgressBar *qProgressBar() const;
};

// ProgressBarDelegate :: Public Inline Member Function. -----------------------

/*!
 * \brief Returns QProgressBar adaptee.
 *
 * \return QProgressBar adaptee
 */
inline QProgressBar *ProgressBarDelegate::qProgressBar() const
{
  return static_cast<QProgressBar *>(qObject());
}

// Macro Definition. -----------------------------------------------------------

#define PROGRESS_BAR_DELEGATE \
    (reinterpret_cast<ProgressBarDelegate *>(delegate))

#endif // PROGRESSBARDELEGATE_H
